<?php
session_start();
// session_register('adminlogin');
header('Content-Type: text/html; charset=UTF-8');
include "include/dbconnect.inc.php";
include "include/adminconfig.inc.php";

$Template = new adminTemplate();
$adminHome = new adminHome();

echo $Template -> HtmlStart();
echo $Template -> HeaderStart();
echo $Template -> Meta($title);
echo $Template -> HeaderStop();
echo $Template -> BodyStart();

if(isset($_SESSION['adminlogin']['id'])) {
    echo $Template -> WrapStart();
    echo $Template -> TopStart();
        echo $Template -> Logo();
        echo $adminHome -> LogoutButton();
    echo $Template -> TopStop();
    echo $Template -> ContentStart();
}

// Home Seite

if ($_REQUEST['id'] == FALSE || $_REQUEST['id'] == "home") {
    echo $adminHome -> Home();
    echo $adminHome -> LoginForm();
}

if ($_REQUEST['id'] == "kunde") {
    echo $adminHome -> Kunde();
}


//////////////////////////////
if(isset($_SESSION['adminlogin']['id'])) {
echo $Template -> ContentStop();
echo $Template -> WrapStop();
}

echo $Template -> BodyStop();
echo $Template -> HtmlStop();

?>